﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

///<summary>
///
///</summary>
public class TransformHelper : MonoBehaviour {

	public static Transform FindClarityTransform(Transform parentTransform, string findName)
    {
        Transform resultTransform = parentTransform.Find(findName);
        if (resultTransform)
        {
            return resultTransform;
        }

        int childCount = parentTransform.childCount;
        for(int index=0; index<childCount; index++)
        {
            resultTransform = FindClarityTransform(parentTransform.GetChild(index), findName);
            if (resultTransform)
            {
                return resultTransform;
            }
        }

        return null;
    }
}
